package com.funds.web.action;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;
import org.springframework.stereotype.Controller;

import com.funds.service.GoodsTypeService;

@Controller("/goods")
public class GoodsAction extends DispatchAction {
	@Resource
	private GoodsTypeService goodsTypeService;
	
	@Override
	public ActionForward execute(ActionMapping arg0, ActionForm arg1,
			HttpServletRequest arg2, HttpServletResponse arg3) throws Exception {
		return super.execute(arg0, arg1, arg2, arg3);
	}

	public ActionForward goodsTypeList(ActionMapping mapping, ActionForm form,
			HttpServletRequest req, HttpServletResponse resp) throws Exception {
		req.setAttribute("typelist", goodsTypeService.findAll());
		return mapping.findForward("typelist");
	}
}
